
import service from "@/api/index.js";
//将所有的针对admin的请求都封装到一个对象中
const coachApi = {
    /*获取所有教练信息*/
    getAllCoach(params){
        return service.get('/coach',{params}).then(response=>response.data)
    },
    /*添加教练*/
    addCoach(coach){
        return service.post('/coach/addCoach',coach).then(response=>response.data)
    },
    /*校验手机号*/
    checkPhone(phone){
        return service.get('/coach/checkPhone',{params:{phone:phone}}).then(resp=>resp.data)
    },
    /*删除教练*/
    deleteCoach(id){
        return service.get('/coach/deleteCoach',{params:{id:id}}).then(resp=>resp.data)
    },
    /*编辑*/
    editCoach(coach){
        return service.post('/coach/editCoach',coach).then(resp=>resp.data)
    },
    /*校验编辑手机号*/
    checkEditPhone(coach){
        return service.post('/coach/checkEditPhone',coach).then(resp=>resp.data)
    },
    /*批量删除*/
    delSelected(ids){
        return service.post('/coach/delSelected',ids).then(resp=>resp.data)
    }
}
export default coachApi;